package cn.le.theme;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 项目名  spring-boot
 * Created by lansp
 * Created at 2018/6/1
 * 描述:
 */
@Component
public class TopicSend {

	@Autowired
	private AmqpTemplate template;

	public void send1(){
		String context = "h1 , i am message topic.1";
		System.out.println("Send1 : " + context);
		template.convertAndSend("topicExchange","topic.1",context);
	}

	public void send2(){
		String context = "h1 , i am message topic.message";
		System.out.println("Send2 : " + context);
		template.convertAndSend("topicExchange","topic.message",context);
	}
	public void send3(){
		String context = "h1 , i am message topic.msg";
		System.out.println("Send3 : " + context);
		template.convertAndSend("topicExchange","topic.msg",context);
	}

}
